<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>user</title>
    <link rel="stylesheet" th:href="@{/css/bootstrap.css}"></link>
    <link th:href="@{/css/shop.css}" type="text/css" rel="stylesheet" />
    <link th:href="@{/css/Sellerber.css}" type="text/css"  rel="stylesheet" />
    <link th:href="@{/css/bkg_ui.css}" type="text/css"  rel="stylesheet" />
    <link th:href="@{/font/css/font-awesome.min.css}"  rel="stylesheet" type="text/css" />
    <script th:src="@{/js/jquery-1.9.1.min.js}" type="text/javascript" ></script>
    <script type="text/javascript" th:href="@{/js/jquery.cookie.js}"></script>
    <script th:href="@{/js/shopFrame.js}" type="text/javascript"></script>
    <script th:href="@{/js/Sellerber.js}" type="text/javascript"></script>
    <script th:href="@{/js/layer/layer.js}" type="text/javascript"></script>
    <script th:href="@{/js/laydate/laydate.js}" type="text/javascript"></script>

</head>
<body class="container">
<br/>
<h4>添加类别</h4>
<br/><br/>
<div class="width:80%">
    <form class="form-horizontal"   th:action="@{add}"  enctype="multipart/form-data" method="get">
        <div class="form-group">
            <label for="typeName" class="col-sm-2 control-label" >类别名称</label>
            <div class="col-sm-3">
                <input type="text" class="form-control" name="typeName"  id="typeName" placeholder="添加的类别名称岂能为空" th:width="50px"/>
            </div>
        </div>
        <div class="form-group">
            <label  class="col-sm-2 control-label" th:width="50px">类别id</label>
            <div class="col-sm-3">
                <select name="fatherId" id="fatherType">
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <input type="submit" value="Submit" class="btn btn-info" />
                &nbsp; &nbsp; &nbsp;
                <input type="reset" value="Reset" class="btn btn-info" />
            </div>

        </div>
    </form>
</div>
</body>
</html>
<script>
    $(function () {
        selectBigType();
    })
    function selectBigType(){
        $.getJSON("/showtype/father","fatherId=0",function(data){
            $("#fatherType").append("<option value='0'>请选择类型名称</option>");
            $.each(data,function(i,e){
                $("#fatherType").append("<option value='"+e.showTypeId+"'>"+e.typeName+"</option>");
            });
        });
    }


</script>
